import React, { useRef, forwardRef, useImperativeHandle } from "react"
import { Button, Divider, Space, } from "@bytedance/mona-ui"
import { ItemData } from "./funcItem";
import Title from './title'
import Zhutu from './zhutu'
import Sku from './sku'
import { formatFuncDeteail } from './formatFunc'

function SetMaxCopy(props: any, ref: any) {
    // const titleRef = useRef<any>(null)
    const zhutuRef = useRef<any>(null)
    // const skuRef = useRef<any>(null)
    console.log('props', props)

    function upAddProdectFunc(type, cb?: Function) {
        formatFuncDeteail({
            title: {}, //titleRef.current,
            zhutu: zhutuRef.current,
            sku: {}, //skuRef.current,
            props,
            type,
            cb
        })
    }
    useImperativeHandle(ref, () => ({
        upAddProdectFunc
    }))
    return <Space direction="vertical" style={{ width: '100%' }} className="contehrsdfee">
        <h3>精简模式</h3>
        <div className="contentsdfr" >
            <div className="rightContent">
                {/* <Title ref={titleRef} />
                <Divider /> */}
                <Zhutu ref={zhutuRef} />
                {/* <Divider />
                <Sku ref={skuRef} /> */}
            </div>
        </div>
        {/* <Button type="primary" onClick={() => {
            console.log('titleRef.current', titleRef.current)
            console.log('zhutuRef.current', zhutuRef.current)
            console.log('skuRef.current', skuRef.current)
            upAddProdectFunc(0)
        }}>获取数据</Button> */}
    </Space>
}
export default forwardRef(SetMaxCopy)